<body class="app" data-ad="true">

<section class="app-content">
	<section class="page page-index noline" data-plugin-type="info_front">

        <div class="top-bar">我的代金券<a href="<?php echo $this->url('my', array('action'=>'home'));?>" class="btn-t-back"></a></div>

        <div class="voucher-list">
        <?php foreach ($this->list as $key => $voucher) : ?>
            <div class="v-item">
                <dl>
                    <dt>
                        <?php echo $this->escapeHtml($voucher['vt_name']);?>
                        <p>¥<span><?php echo $this->escapeHtml($voucher['vt_price']);?>元</span></p>
                    </dt>
                    <dd>
                        <p><?php
                        if(!empty($voucher['org_id'])) {
                            echo $this->escapeHtml($voucher['org_name']).'商家专属';
                        } elseif(!empty($voucher['product_id'])) {
                            echo $this->escapeHtml($voucher['product_name']).'商品专属';
                        } else {
                            echo "全品类";
                        }
                        ?></p>
                        <p>满<?php echo $this->escapeHtml($voucher['vt_limit_price']);?>可用</p>
                    </dd>
                </dl>
                <div class="v-ope">
                    <span><?php echo $this->escapeHtml($voucher['vt_start_time']);?>－<?php echo $this->escapeHtml($voucher['vt_end_time']);?></span>
                     <a href="<?php echo $this->url('home');?>" class="btn-v-use">使用代金券</a>
                    <a class="btn-v-des fl">详细信息</a>
                    <div class="v-des"><?php echo $this->escapeHtml($voucher['vt_remark']);?></div>
                </div>
            </div>
		  <?php endforeach; ?>
        
        </div>
	</section>

    <!-- 底部menu-->
    <?php echo $this->partial('public/menu.phtml'); ?>
</section>

<div class="bgMask"></div>
<div class="popup popVoucher">
    <p>添加代金券</p>
    <p><input type="text" placeholder="请输入您的代金券码"></p>
    <a href="javascript:;" class="btn-pv-add">添加</a>
</div>

<script type="text/javascript">
$(function () {


   $('.v-ope .btn-v-des').each(function(){
       $(this).click(function(){
           if($(this).hasClass('btn-v-des-up')) {
               $(this).removeClass('btn-v-des-up').next('.v-des').hide();
           }else{
               $(this).addClass('btn-v-des-up').next('.v-des').show();
           }

       })
   })
    $('.btn-t-add').click(function(){
        showVoucher();
    })

    $('.bgMask').click(function(){
        hideVoucher();
    })

    function hideVoucher(){
        $('.bgMask,.popup').hide();
    }
    function showVoucher(){
        $('.bgMask,.popup').show();
    }
});
</script>
